package com.hooda.demo.controller;

import com.hooda.demo.service.IDemoService;
import com.hooda.framework.annotation.Autowired;
import com.hooda.framework.annotation.Controller;
import com.hooda.framework.annotation.RequestMapping;
import com.hooda.framework.annotation.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author zhangzp
 * @version 1.0
 * @date 2021/9/15
 */
@Controller
@Security({"admin","root"})
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private IDemoService demoService;

    @Security("zhangsan")
    @RequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        return demoService.get(name);
    }
}
